//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

//====================================================
// Created     : 2004-1-7
// Author      : Fan Dian
// Description : Some Test Help Functions
//====================================================

#ifndef __ELASTOS_KTESTF_TESTHLP_H__
#define __ELASTOS_KTESTF_TESTHLP_H__

#include <core.h>

//====================================================
// Description  : Print the memory section
// Parameters   : [in] byte* pbByte  : the start address of the memory section
//                [in] uint_t unSize : the count of data printed by Byte
// Return       : None
// Supplement   : 16 bytes are printed every line
//====================================================
inline void TestPrintMem(byte* pbByte, uint_t unSize)
{
    for (uint_t i = 0; i < unSize; i++) {
        if (!(i % 16)) {
            if (i) kprintf("\n");
            kprintf("    %2d -> %2d: ", i, i + 15);
        }
        Byte bData = pbByte[i];
        kprintf("%1x%1x ", bData >> 4, bData & 0x0f);
    }
    kprintf("\n");
}

#endif // #ifndef __ELASTOS_KTESTF_TESTHLP_H__
